from flask import Blueprint
from . import views


blueprint = Blueprint('api', __name__, url_prefix='/api')
path = blueprint.add_url_rule  # 重命名


# 默认只支持GET请求，POST或其他请求要手动加入 methods=['GET', 'POST']
path('/health', view_func=views.health, endpoint='health')
path('/add_user', view_func=views.add_user, endpoint='add_user', methods=['POST'])
path('/modify_user', view_func=views.modify_user, endpoint='modify_user', methods=['POST'])
path('/user_list', view_func=views.user_list, endpoint='user_list', methods=['GET'])
path('/delete_user', view_func=views.delete_user, endpoint='delete_user', methods=['POST'])
